package com.codi.bus.core.dao.impl;

import com.codi.base.dao.v2.GeneratedBaseDaoImpl;
import com.codi.bus.core.dao.TradeOrdersDao;
import com.codi.bus.core.domain.TradeOrders;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: zengxl
 * @Description:
 * @Date: 2018/4/23 14:02
 */
@Repository
public class TradeOrdersDaoImpl extends GeneratedBaseDaoImpl<TradeOrders> implements TradeOrdersDao {

    @Override
    public TradeOrders selectByAllotNo(TradeOrders order) {
        List<TradeOrders> result = this.findList("selectTradeOrdersByAllotNo",order);
        if(result != null && result.size() > 0){
            return result.get(0);
        }else {
            return null;
        }
    }

    @Override
    public void updateByAllotNoSelective(TradeOrders order) {
        this.update("updateByAllotNoSelective",order);
    }

    @Override
    public List<TradeOrders> selectByTaconfirmFlag(TradeOrders queryVo) {
        return this.findList("selectByTaconfirmFlag",queryVo);
    }

    @Override
    public List<TradeOrders> selectByCreateTime(TradeOrders queryVo) {
        return this.findList("selectByCreateTime",queryVo);
    }

    @Override
    public List<TradeOrders> selectByUpdateTime(TradeOrders queryVo) {
        return this.findList("selectByUpdateTime",queryVo);
    }

    @Override
    public List<TradeOrders> selectFastredeem(TradeOrders queryVo) {
        return this.findList("selectFastredeem",queryVo);
    }

    @Override
    public void deleteByAllotNo(TradeOrders order) {
        this.delete("deleteTradeOrdersByAllotNo",order);
    }

    @Override
    public void updateByPortfolioApplyNo(TradeOrders order) {
        this.update("updateByPortfolioApplyNo", order);
    }

    @Override
    public void updateByApplyNo(TradeOrders order) {
        this.update("updateByApplyNo", order);
    }

    @Override
    public List<TradeOrders> selectSellUnConfirmTrade(TradeOrders order) {
        return this.findList("selectSellUnConfirmTrade", order);
    }

    @Override
    public List<TradeOrders> selectBuyUnConfirmTrade(TradeOrders order) {
        return this.findList("selectBuyUnConfirmTrade", order);
    }

    @Override
    public List<TradeOrders> selectBuyUnConfirmPortfolioTrade(TradeOrders order) {
        return this.findList("selectBuyUnConfirmPortfolioTrade", order);
    }

    @Override
    public List<TradeOrders> selectNoClientId() {
        return this.findList("selectNoClientId", null);
    }
}
